package com.corona.game;

import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Vector2;
import com.corona.Game;

import java.util.ArrayList;

/* compiled from: Battle.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/MovePlayerOffScreen.class */
public class MovePlayerOffScreen extends Action {
    ArrayList<Integer> repeats;
    Vector2 move;
    Sprite sprite;
    public Action.Layer layer = Action.Layer.gui_140;
    Vector2 position = null;
    ArrayList<Vector2> positions = new ArrayList<>();

    public MovePlayerOffScreen(Game game, Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
        this.positions.add(new Vector2(0.0f, 0.0f));
        for (int i = 0; i < 3; i++) {
            this.positions.add(new Vector2(-8.0f, 0.0f));
            this.positions.add(new Vector2(-16.0f, 0.0f));
            this.positions.add(new Vector2(-8.0f, 0.0f));
            this.positions.add(new Vector2(-16.0f, 0.0f));
            this.positions.add(new Vector2(-8.0f, 0.0f));
            this.positions.add(new Vector2(-16.0f, 0.0f));
        }
        this.repeats = new ArrayList<>();
        this.repeats.add(38);
        this.repeats.add(2);
        for (int i2 = 0; i2 < 5; i2++) {
            this.repeats.add(3);
        }
        this.sprite = game.player.battleSprite;
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.positions.isEmpty() || this.repeats.isEmpty()) {
            game.insertAction(this.nextAction);
            game.actionStack.remove(this);
        } else if (this.repeats.get(0).intValue() > 1) {
            this.repeats.set(0, Integer.valueOf(this.repeats.get(0).intValue() - 1));
        } else {
            this.position = new Vector2(game.player.battleSprite.getX(), game.player.battleSprite.getY());
            this.position.add(this.positions.get(0));
            this.sprite.setPosition(this.position.x, this.position.y);
            this.positions.remove(0);
            this.repeats.remove(0);
        }
    }
}
